<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
    {{--*/ $temp1 = isset($aOption['DOT_KIEM_TRA'][$DOT_KIEM_TRA]) ? $aOption['DOT_KIEM_TRA'][$DOT_KIEM_TRA]->data : null; /*--}}
    {{--*/ $temp2 = isset($aOption['LAN_KIEM_TRA'][$LAN_KIEM_TRA]) ? $aOption['LAN_KIEM_TRA'][$LAN_KIEM_TRA]->data : null; /*--}}
    <h4 class="modal-title">{{{ @$User->username }}} {{{ $temp1 }}} {{{ $temp2 }}}</h4>
</div>
<div class="portlet modal-body portlet-body form">
    <!-- BEGIN FORM-->
    <form action="{{ route('score-update') }}" class="form-horizontal" id="form-score" method="post">
        <input type="hidden" name="user_id" value="{{@$User->id}}"/>
        <input type="hidden" name="DOT_KIEM_TRA" value="{{$DOT_KIEM_TRA}}"/>
        <input type="hidden" name="LAN_KIEM_TRA" value="{{$LAN_KIEM_TRA}}"/>
        <div class="form-body">
            <div class="alert alert-danger display-hide">
                <button class="close" data-close="alert"></button>
                {{ trans('validation.custom.error-title') }}
            </div>
            <div class="alert alert-success display-hide">
                <button class="close" data-close="alert"></button>
                <span></span>
            </div>
            <div class="form-group" style="margin-left: 0; margin-right: 0;">
                <label class="control-label col-md-3" for="score">{{ trans('user-score.score') }}</label>
                <div class="col-md-7">
                    <input type="text" name="score" id="score" class="form-control" value="{{{ @$Score->score }}}"/>
                </div>
            </div>
            <div class="form-group" style="margin-left: 0; margin-right: 0;">
                <label class="control-label col-md-3" for="type">{{ trans('system.note') }}</label>
                <div class="col-md-7">
                    <textarea name="note" id="note" class="form-control"></textarea>
                </div>
            </div>
        </div>
    </form>
    <!-- END FORM-->
    @if($aScoreLog->count())
    <div class="form-body">
        <table class="table table-hover" id="sample_3">
            <thead>
                <tr>
                    <th class="text-center">{{ trans('user-score.date') }}</th>
                    <th>{{ trans('user.username') }}</th>
                    <th class="text-center">{{ trans('user-score.score') }}</th>
                    <th>{{ trans('system.note') }}</th>
                </tr>
            </thead>
            <tbody>
                @foreach($aScoreLog as $Log)
                <tr>
                    <td class="text-center">{{ CNamHoa::ConvertDate($Log->updated_at) }}</td>
                    <td>{{ $Log->updaterInfo()->first()->username }}</td>
                    <td class="text-center">{{ $Log->score }}</td>
                    <td>{{ $Log->note }}</td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
    @endif
</div>
<div class="modal-footer">
    <button type="button" class="btn default btn-close-modal" data-dismiss="modal">{{ trans('system.button.cancel') }}</button>
    <button type="button" class="btn blue btn-score-update {{ CNamHoa::getHideClass('score-update', ['addClass' => 'hide']) }}">{{ trans('system.button.submit') }}</button>
</div>
<script type="text/javascript">

    var form = $('#form-score');

    form.keypress(function(e) {
        if (e.which == '13') {
            $('.btn-score-update').trigger('click');
            return false;
        }
    });

    // begin: third table
    $('#sample_3').dataTable({
        "aLengthMenu": [
            [5, 15, 20, -1],
            [5, 15, 20, "All"] // change per page values here
        ],
        "iDisplayLength": 5,
        "sPaginationType": "bootstrap",
        "oLanguage": _DatatableLanguage,
        "aoColumnDefs": [
            {"bSearchable": false, "aTargets": [0]}
        ]
    }).parent().parent().find('div.row').css({
        'margin-left': 0,
        'margin-right': 0
    });

    jQuery('#sample_3 .group-checkable').change(function() {
        var set = jQuery(this).attr("data-set");
        var checked = jQuery(this).is(":checked");
        jQuery(set).each(function() {
            if (checked) {
                $(this).attr("checked", true);
            } else {
                $(this).attr("checked", false);
            }
        });
        jQuery.uniform.update(set);
    });

    jQuery('#sample_3_wrapper .dataTables_filter input').addClass("form-control input-small input-inline"); // modify table search input
    jQuery('#sample_3_wrapper .dataTables_length select').addClass("form-control input-xsmall"); // modify table per page dropdown
    jQuery('#sample_3_wrapper .dataTables_length select').select2(); // initialize select2 dropdown
</script>